import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUnipayAppletsController } from '../../../controllers';
const uctoounipayAppletsRouter = new Router();
const unipayAppletsController = new uctooUnipayAppletsController();

uctoounipayAppletsRouter.post('/add', requireUser, unipayAppletsController.add);
uctoounipayAppletsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/unipay_applets'), unipayAppletsController.edit);
uctoounipayAppletsRouter.post('/del', requireUser, rowLevelPermission('uctoo/unipay_applets'), unipayAppletsController.delete);

//For getting unipayApplets with permission control
uctoounipayAppletsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/unipay_applets'), unipayAppletsController.getSingle);
uctoounipayAppletsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/unipay_applets'), unipayAppletsController.getMany);
uctoounipayAppletsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/unipay_applets'), unipayAppletsController.getMany);

//#endregion AutoCreateCode
export default uctoounipayAppletsRouter;
